import { request } from '@/network/request.js';
//获取角色列表
export const netRoles = () => {
  return request({
    url: '/Maintain/SelectRole',
  });
};
//根据id获取树对象
export const netGetRolesById = (id) => {
  return request({
    url: '/Maintain/TreeRole',
    params: id,
  });
};
//角色授权
export const netGiveRightForRole = (params) => {
  return request({
    method: 'get',
    url: `/Maintain/GiveRights`,
    params,
  });
};
//新增角色
export const netAddRoles = (data) => {
  return request({
    method: 'post',
    url: '/Maintain/AddRole/btn-roleadd',
    data,
  });
};

//修改
export const netEditRolesById = (data) => {
  return request({
    method: 'post',
    url: `/Maintain/UpdateRole/btn-roleupdate`,
    data,
  });
};
//删除
export const netDeleteRolesById = (params) => {
  return request({
    method: 'get',
    url: `/Maintain/DeleteRole/btn-roledelete`,
    params,
  });
};
